package com.example.demo.config;

import com.h3c.iotframework.KongMqDispatcher;
import com.h3c.iotframework.UrlMethodResolver;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xieluoyin
 *  
 */
@Configuration
public class IotConfig extends UrlMethodResolver{

    private final
    RabbitTemplate rabbitTemplate;


    @Autowired
    public IotConfig(RabbitTemplate rabbitTemplate) {
        this.rabbitTemplate = rabbitTemplate;
    }

    @Bean
    public KongMqDispatcher kongMqDispatcher(){

        return new KongMqDispatcher(this,rabbitTemplate);
    }

}
